package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public class AuditBase extends Jpo {

    @Column(name = "user_id")
    private Long userId ;

    @Column(name = "project_id")
    private Long projectId ;

    @Column(name = "audit_number")
    private Integer auditNumber;

    @Column(name = "audit_name")
    private String auditName;

    @Column(name = "audit_photo")
    private String auditPhoto;

    @Column(name = "create_time")
    private Timestamp createTime;

    @Column(name = "status")
    private Integer status;

    @Column(name = "reason")
    private String reason;

    @Column(name = "type")
    private Integer type;


    protected void copyBase(AuditBase other) {
        setUserId(other.getUserId());
        setProjectId(other.getProjectId());
        setAuditNumber(other.getAuditNumber());
        setAuditName(other.getAuditName());
        setAuditPhoto(other.getAuditPhoto());
        setCreateTime(other.getCreateTime());
        setStatus(other.getStatus());
        setReason(other.getReason());
        setType(other.getType());
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        if(userId == null) {
            this.userId = 0L;
        } else {
            this.userId = userId;
        }
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        if(projectId == null) {
            this.projectId = 0L;
        } else {
            this.projectId = projectId;
        }
    }

    public Integer getAuditNumber() {
        return auditNumber;
    }

    public void setAuditNumber(Integer auditNumber) {
        this.auditNumber = auditNumber;
    }

    public String getAuditName() {
        return auditName;
    }

    public void setAuditName(String auditName) {
        this.auditName = auditName;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getAuditPhoto() {
        return auditPhoto;
    }

    public void setAuditPhoto(String auditPhoto) {
        this.auditPhoto = auditPhoto;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
